<template>
	<view class="item bg-white" @click="handleGoods(data)">
		<image class="cu-avatar margin-right-bj" :src="$wanlshop.oss(data.doctor.image)" mode="aspectFill"></image>
		<view class="subject">
			<view class="text-cut-2 text-df wanl-gray-dark">
				<text style="margin-right: 4rpx;margin-bottom: 6rpx;" class="cu-tag radius sm bg-green">医生</text>
				{{data.doctor.name}}   {{data.doctor.doctor_level_text}}
			</view>
			<view class="flex justify-between align-center">
				<view class="text-bold"> {{data.doctor.hospital_id_text}}</view>
				<view class="button text-bold text-sm wanl-gray-light">
					<text class="icon-shanchu1 iconfont" @click.stop="loadFollow(data.id, index)"></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	export default {
		name: 'wanl-colllect-circle',
		props: {
			data: {
				type: Object,
				default () {
					return {};
				}
			},
		},
		data() {
			return {

			}
		},
		computed: {
			...mapState(['user', 'common'])
		},
		methods: {

			handleGoods(item) {
						this.$wanlshop.to(`/pages/medicalcare/bookingsystem/doctor?id=${item.doctor_id}`)
			},

			async loadFollow(id, index) {
				await uni.request({
					url: '/addons/internethospital/api.collect/del',
					method: 'POST',
					data: {
						ids: id
					},
					success: res => {
						this.$wanlshop.msg('取消收藏')
						this.$emit('delCollect')
					}
				});
			},
		}
	}
</script>

<style lang="less" scoped>
	.imgs {
		margin: 10rpx 0;

		image {
			width: 100rpx;
			height: 100rpx;
			margin-right: 10rpx;
		}
	}

	.cu-avatar {
		height: 120rpx;
		width: 120rpx;
		flex-shrink: 0;
		border-radius: 50%;
	}

	.subject {
		display: flex;
		width: calc(100% - 145rpx);
		height: 100%;
		// flex-wrap: wrap;
		// align-content: space-between;
		flex-direction: column;
		justify-content: space-between;

		&>view {
			width: 100%;
		}

		.menu {
			display: flex;
			justify-content: space-between;

			.button {
				&>text+text {
					margin-left: 40rpx;
					margin-right: 10rpx;
				}
			}
		}
	}
</style>